<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
         1.   
        var a = {}; // 创建了一个空的对象
        2.
        var stu = {
            name: '蔡徐坤',
            height: 175,
            weight: 170,
            run: function() {
                console.log("hello");
                alter('hello');
            }
        }

        stu.run;
        console.log(stu.run);

        //###获取属性值
        console.log(stu.height);
        console.log(stu['height'])

        //###添加
        stu.sex='男'
        //###修改
        stu.weight=90;

        //###遍历对象--了解
        for(var jieshou in stu){
            console.log('属性名：'+jieshou+',属性值:'+stu[jieshou])
        }
    </script>
</body>
</html>